package com.sam.log4j2example.controller;

import com.sam.log4j2example.entity.Response;
import com.sam.log4j2example.marker.LogMarker;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
@RequestMapping("/example")
public class IndexController {

    @GetMapping("/index")
    public Response index(@RequestParam("id") Integer id) {
        log.trace("trace");
        log.info(LogMarker.SERVICE_MARKER, "您好");
        log.info("info");
        log.warn("warn");
        log.error("error");
        String str = "";
        Class cls = str.getClass();
        log.warn("id = {}", id);
        return new Response<String>(1, "asd");
    }
}
